﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Codeology.Auctioneer
{

    public enum AuctioneerItemType : int
    {
        Unknown = 0,
        Gem,
        Quest,
        Consumable,
        TradeGoods,
        Container,
        Miscellaneous,
        Armor,
        Weapon,
        Recipe,
        Glyph,
        Reagent
    }

    public static partial class Converter
    {

        #region Methods

        public static string ItemTypeToString(AuctioneerItemType itemType)
        {
            switch (itemType) {
                case AuctioneerItemType.Gem:           return "Gem";
                case AuctioneerItemType.Quest:         return "Quest";
                case AuctioneerItemType.Consumable:    return "Consumable";
                case AuctioneerItemType.TradeGoods:    return "Trade Goods";
                case AuctioneerItemType.Container:     return "Container";
                case AuctioneerItemType.Miscellaneous: return "Miscellaneous";
                case AuctioneerItemType.Armor:         return "Armor";
                case AuctioneerItemType.Weapon:        return "Weapon";
                case AuctioneerItemType.Recipe:        return "Recipe";
                case AuctioneerItemType.Glyph:         return "Glyph";
                case AuctioneerItemType.Reagent:       return "Reagent";
                default:                                return "Unknown";
            }
        }

        public static AuctioneerItemType StringToItemType(string str)
        {
            str = str.ToLower();

            if (str == "gem") return AuctioneerItemType.Gem;
            if (str == "quest") return AuctioneerItemType.Quest;
            if (str == "consumable") return AuctioneerItemType.Consumable;
            if (str == "trade goods") return AuctioneerItemType.TradeGoods;
            if (str == "container") return AuctioneerItemType.Container;
            if (str == "miscellaneous") return AuctioneerItemType.Miscellaneous;
            if (str == "armor") return AuctioneerItemType.Armor;
            if (str == "weapon") return AuctioneerItemType.Weapon;
            if (str == "recipe") return AuctioneerItemType.Recipe;
            if (str == "glyph") return AuctioneerItemType.Glyph;
            if (str == "reagent") return AuctioneerItemType.Reagent;

            return AuctioneerItemType.Unknown;
        }

        #endregion

    }

}
